/*
 * @Author: Li Zengkun
 * @Date: 2022-09-26 19:54:33
 * @LastEditors: Li Zengkun
 * @LastEditTime: 2022-09-26 20:07:26
 * @Description: 
 */
import axios from "axios"

// 为指定角色删除菜单
const remove = (id, params) => axios.delete(`/role/menu/${id}`, { params })

// 为指定角色添加菜单
const add = (data) => axios.post('/role/menu', data)

// 删除角色
const removeRole = (id, params) => axios.delete(`/role/${id}`, { params })

// 更新角色
const update = (id, data) => axios.put(`/role/${id}`, data)

// 根据角色id获取菜单配置
const getMenuByRoleId = (params) => axios.get(`/role/config`, { params })

// 根据角色获取侧边栏菜单
const getSideBar = (params) => axios.get(`/role/menu/`, { params })

// 添加角色
const addRole = (data) => axios.post('/role', data)

// 获取角色列表
const getRoleList = (params) => axios.get(`/role/list`, { params })

export default {
    remove,
    add,
    update,
    removeRole,
    getMenuByRoleId,
    getSideBar,
    addRole,
    getRoleList
}